home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
By Popular Request 2.0
/
By Popular Request 2.0 (Arsenal Computer).ISO
/
amiga_1
/
amytemp.lha
/
AmigaTemp
/
ARexxScr
/
WatchAlarm.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-05-20
|
3KB
|
68 lines
/* AmigaTemp ARexx */
/* Waits on ARexx temperature alarm. Break with Control+C */
call addlib('rexxsupport.library',0,-30,0) /* Needed by Delay */
/* Start */
st = Show(P, 'AmigaTemp') /* Is program running? */
if st == 0 then /* No... */
do
Address COMMAND
'CCT1.1:CCT CX_POPUP=NO' /* Start AmigaTemp. Don't POPUP */
if rc > 0 then do /* Program not found... */
Say "Can't start AmigaTemp"
exit
end
do 2 while ~Show(P, 'AmigaTemp') /* Wait until program has started or at least 20 sek */
'waitforport AmigaTemp'
end
if ~Show(P, 'AmigaTemp') then do /* Something is wrong... */
Say "Can't start AmigaTemp"
exit
end
end
/* Main */
Options RESULTS /* Retrive the string result field */
Address 'AmigaTemp' /* Portname for AmigaTemp (Case sensitive) */
'Version'; Say result
Say 'Break with Control+C'
'NumSensor'; numsensor = result /* Number Of Sensors */
do until 1 = 0 /* Loop for ever */
do i=1 to numsensor
'Alarm' i /* Check alarm */
If rc == 0 then /* rc == 0 if sensor is connected */
do
If result == 'Max' then /* Current temperature > max temperature */
do
'Name' i; name = result /* Name of sensor */
'Temp' i; temp = result /* Current temperature */
'AlarmMax' i; max = result /* Max temperature */
'AlarmTextMax' i; textmax = result /* Text for max temperature */
Say name || ':' || ' Max : ' || max || ' Current : ' || temp || ' ' || textmax
end
If result == 'Min' then /* Current temperature < min temperature */
do
'Name' i; name = result /* Name of sensor */
'Temp' i; temp = result /* Current temperature */
'AlarmMin' i; min = result /* Max temperature */
'AlarmTextMin' i; textmin = result /* Text for max temperature */
Say name || ':' || ' Min : ' || min || ' Current : ' || temp || ' ' || textmin
end
end
end i
call Delay(3*50) /* Wait 3 sec */
end
if st == 0 then 'Quit' /* Quit AmigaTemp if we started it */